package com.ruicar.afs.cloud.apply.pre.loan.controller;

import com.ruicar.afs.cloud.apply.business.service.WorkflowAgencyTaskService;
import com.ruicar.afs.cloud.apply.common.entity.ApplyConditionApproval;
import com.ruicar.afs.cloud.apply.pre.loan.condition.ApplyConditionApprovalCondition;
import com.ruicar.afs.cloud.common.core.util.IResponse;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * 附条件核准controller
 *
 * @author 耿继辉
 */
@RestController
@Slf4j
@ApiOperation("附条件核准controller")
@AllArgsConstructor
@RequestMapping("/conditionApproval")
public class ApplyConditionApprovalController {

    private final WorkflowAgencyTaskService workflowAgencyTaskService;

    /**
     * 查询附条件核准数据
     *
     * @param condition
     * @return
     */
    @RequestMapping("/getApplyConditionApprovalInfo")
    @ApiOperation("查询附条件核准数据")
    public IResponse<ApplyConditionApproval> getApplyConditionApprovalInfo(@RequestBody ApplyConditionApprovalCondition condition) {
        Map applyConditionApprovalInfo = workflowAgencyTaskService.getApplyConditionApprovalInfo(condition);
        return IResponse.success(applyConditionApprovalInfo);
    }
}
